package com.wandong.cinema.entity;

import java.util.Date;
import java.util.List;

public class Ticket {
    private String ticketId;
    private String showId;
    private List<String> seatIds;
    private Date saleTime;
    private double totalPrice;
    private boolean isChild;
    private boolean isRefunded;

    public Ticket(String ticketId, String showId, List<String> seatIds, Date saleTime, 
                 double totalPrice, boolean isChild, boolean isRefunded) {
        this.ticketId = ticketId;
        this.showId = showId;
        this.seatIds = seatIds;
        this.saleTime = saleTime;
        this.totalPrice = totalPrice;
        this.isChild = isChild;
        this.isRefunded = isRefunded;
    }

    public String getTicketId() {
        return ticketId;
    }

    public void setTicketId(String ticketId) {
        this.ticketId = ticketId;
    }

    public String getShowId() {
        return showId;
    }

    public void setShowId(String showId) {
        this.showId = showId;
    }

    public List<String> getSeatIds() {
        return seatIds;
    }

    public void setSeatIds(List<String> seatIds) {
        this.seatIds = seatIds;
    }

    public Date getSaleTime() {
        return saleTime;
    }

    public void setSaleTime(Date saleTime) {
        this.saleTime = saleTime;
    }

    public double getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(double totalPrice) {
        this.totalPrice = totalPrice;
    }

    public boolean isChild() {
        return isChild;
    }

    public void setChild(boolean child) {
        isChild = child;
    }

    public boolean isRefunded() {
        return isRefunded;
    }

    public void setRefunded(boolean refunded) {
        isRefunded = refunded;
    }

    @Override
    public String toString() {
        return String.format("票号: %s, 场次ID: %s, 座位: %s, 售价: %.2f, 售票时间: %s, %s, %s",
                ticketId, showId, seatIds, totalPrice, saleTime,
                isChild ? "儿童票" : "成人票",
                isRefunded ? "已退票" : "正常票");
    }
}
